#pragma once

class Interface_SplashScreen_Effect_Rose
{
	class RoseBed_Action : public Graphic_Particle_PolicyTemplate
	{
	public:
		inline virtual void operator()(Graphic_Particle & Target)
		{
			Target.mBearing += Target.mVelocity.x * mfInterval;
			if(abs(Target.mBearing) < Target.mLifeDelta) return;
			Target.mVelocity.x = -Target.mVelocity.x;
		}
	};
	class RoseBed_Initialize : public Graphic_Particle_PolicyTemplate
	{
		int InitCounter;
	public:
		RoseBed_Initialize() : InitCounter(0){}
		inline virtual void Begin(const float & Interval)
		{
			mfInterval = Interval;
		}
		inline virtual void operator()(Graphic_Particle & Target)
		{
			Target.mLife = 255.0f;
			Target.mPosition.y	+=	System_Utility :: RandomFloat(-10.0f, 10.0f);
			Target.mLifeDelta	=	System_Utility :: RandomFloat(0.1791f, 0.3491f);

			if(InitCounter > 6)	Target.mVelocity.x = -	System_Utility :: RandomFloat(0.05f, 0.2f);
			else				Target.mVelocity.x =	System_Utility :: RandomFloat(0.05f, 0.2f);
			(InitCounter > 10)? InitCounter = 0 : InitCounter++;
		}
	};
	typedef Graphic_ParticleSystem <RoseBed_Initialize, RoseBed_Action> ParticleSystem;
	SmartPtr <ParticleSystem>	mHandler;
	SmartPtr <hgeSprite>		mRoseImg;
public:
	Interface_SplashScreen_Effect_Rose();
	~Interface_SplashScreen_Effect_Rose();

	bool Initialize();

	void Update(const float & Interval);
	void Render();
};